<?php
header('Content-Type:text/html;charset=utf-8');
require_once('include/config.php');
require_once('include/wp-db.php');
require_once('include/utils.php');

$time=time();

$username=$_POST['search_username'];
$phone=$_POST['search_phone'];
$email=$_POST['search_email'];

if(strlen_utf8($username)>8 || empty($username) || strlen_utf8($username)<2)
{

			$error[]="用户名不正确";
			ShowMsg('对不起，用户名不正确','index.php');	
			exit;

}
elseif(!preg_match("/^[\x80-\xff_a-zA-Z0-9]+$/",$username)){
	
			$error[]="用户名不正确";

			ShowMsg('对不起，用户名不正确','index.php');	
			exit;
	
}


//验证手机号码
if(!preg_match("/^((13[0-9])|(15[0-9])|(18[0-9])|(14[0-9]))[0-9]{8}$/i",$phone))
{
			$error[]="手机格式不正确";
			ShowMsg('对不起,手机格式不正确','index.php');	
			exit;
		
}

//验证email
if(!preg_match("/^(?:[a-z\d]+[_\-\+\.]?)*[a-z\d]+@(?:([a-z\d]+\-?)*[a-z\d]+\.)+([a-z]{2,})+$/i",$email))
{
		$error[]="Email格式不正确";
		ShowMsg('对不起，Email格式不正确','index.php');	
		exit;
	
}




?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>汉庭海友客栈</title>
<link href="css/style.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="js/jquery-1.6.2.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {
	$('.gtl').click(function(){
		$("#login").before("<div id='exposeMask' style='*height:"+$("body").height()+"px'></div>");
		$("#login").show();
    });
	$('.close').click(function(){
		$("#exposeMask").remove();
		$("#login").hide();
    });
});
</script>
</head>
<body>
<div id="header">
	<div class="logo"><a href="index.php"></a></div>
	<div class="menu">
		<ul>
			<li><a href="./"><img src="images/menu_1.png" alt="首页" /></a></li>
			<li><a href="list.php"><img src="images/menu_2_.png" alt="今日秒杀" /></a></li>
			<li><a href="next.php"><img src="images/menu_3.png" alt="下期预告" /></a></li>
			<li><a href="photo.php"><img src="images/menu_4.png" alt="客栈相册" /></a></li>
			<li><a href="qa.php"><img src="images/menu_5.png" alt="常见问题" /></a></li>
		</ul>
	</div>
	<div class="banner">
		<div class="nav">
			<ul>
				<li><a class="gtl"><img src="images/nav_login.png" /></a></li>
				<li><a href="explain.php"><img src="images/nav_explain.png" /></a></li>
				<li><a href="http://www.htinns.com/hanting/KZDefault.aspx"  target="_blank"><img src="images/nav_website.png" /></a></li>
			</ul>
		</div>
			<?php include('share.php');?>
	</div>
</div>
<div id="main" class="fix">
<?php include('left.php');?>
	<div class="right">
		<div style="padding:20px 0 0 0">
			<table cellpadding="0" cellspacing="0" class="tad">
				<tr>
					<th>秒杀时间</th>
					<th>秒杀产品</th>
				</tr>
				<?php  
				
				$sql="select * from users_cp where username='$username' and phone='$phone' order by id desc limit 10";
				
				$rs=$wpdb->get_results($sql);
				
				if($rs!=NULL)
				{
					
					foreach($rs as $v)
					{
						
						$cpid=$v->cpid;
						$addtime=$v->addtime;
						
						$sql_cp="select * from miao_cp where id='$cpid'";
						$rs_cp=$wpdb->get_row($sql_cp);
						if($rs_cp!=NULL)
						{
							$subtitle=$rs_cp->subtitle;
						?>
                          <tr>
                            <td><?php echo date('Y-m-d H:i:s',$addtime);?></td>
                            <td><?php echo $subtitle;?></td>
                        </tr>
                        
                        <?php	
							
								
						}
						
						
					}
				}
				
				else{
							?>
                            
                            <tr>
                            <td style="font-size:16px; color:red">对不起没有查询你要的数据</td>
                            <td></td>
                        	</tr>
                            <?php
							
						}
				?>
			</table>
		</div>
	</div>
</div>
<?php include('footer.php');?>
<?php include('logintemplate.php');?>
</body>
</html>
